<{include file="public/header.html"}>
<link rel="stylesheet" type="text/css" href="/static/default/css/index.css"/>
<script src="/static/public/jquery.pagination.js" type="text/javascript" charset="utf-8"></script>
<div class="credit-main w1180-con mt20">
    <div class="mb20" style="height: 193px; background: url(/static/default/img/introduce/4.jpg) no-repeat center 0;"></div>
    <!--<div class="credit-card" style="border: 1px dashed #ccc;">-->
    <!--<div class="credit-card-type">-->
    <!--&lt;!&ndash;信用卡&#45;&#45;银行分类&ndash;&gt;-->
    <!--<{if $bank_type}>-->
    <!--<div class="credit-classify credit-classify-more clear">-->
    <!--<p><{$bank_type['title']}>：</p><a href='javascript:void(0);' class="credit-selected hover-style" data-id="0">不限</a>-->
    <!--<ul>-->
    <!--<{foreach from=$bank_type['children'] item=val}>-->
    <!--<li><a href='javascript:void(0);' class="hovering" data-id="<{$val['id']}>"><{$val['title']}></a></li>-->
    <!--<{/foreach}>-->
    <!--</ul>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--<{/if}>-->
    <!--&lt;!&ndash;信用卡-&#45;&#45;用途&ndash;&gt;-->
    <!--<{if $use_type}>-->
    <!--<div class="credit-classify credit-use clear">-->
    <!--<p><{$use_type['title']}>：</p><a href='javascript:void(0);' class="credit-selected hover-style" data-id="0">不限</a>-->
    <!--<ul>-->
    <!--<{foreach from=$use_type['children'] item=val}>-->
    <!--<li><a href='javascript:void(0);' class="hovering" data-id="<{$val['id']}>"><{$val['title']}></a></li>-->
    <!--<{/foreach}>-->
    <!--</ul>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--<{/if}>-->
    <!--&lt;!&ndash;信用卡-&#45;&#45;等级&ndash;&gt;-->
    <!--<{if $degree_type}>-->
    <!--<div class="credit-classify credit-level clear">-->
    <!--<p><{$degree_type['title']}>：</p><a href='javascript:void(0);' class="credit-selected hover-style" data-id="0">不限</a>-->
    <!--<ul>-->
    <!--<{foreach from=$degree_type['children'] item=val}>-->
    <!--<li><a href='javascript:void(0);' class="hovering" data-id="<{$val['id']}>"><{$val['title']}></a></li>-->
    <!--<{/foreach}>-->
    <!--</ul>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--<{/if}>-->
    <!--</div>-->
    <!--<div class="credit-card-type2">-->
    <!--&lt;!&ndash;信用卡-&#45;&#45;币种&ndash;&gt;-->
    <!--<{if $coin_type}>-->
    <!--<div class="credit-classify credit-currency clear">-->
    <!--<p><{$coin_type['title']}>：</p><a href='javascript:void(0);' class="credit-selected hover-style" data-id="0">不限</a>-->
    <!--<ul>-->
    <!--<{foreach from=$coin_type['children'] item=val}>-->
    <!--<li><a href='javascript:void(0);' class="hovering" data-id="<{$val['id']}>"><{$val['title']}></a></li>-->
    <!--<{/foreach}>-->
    <!--</ul>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--<{/if}>-->
    <!--&lt;!&ndash;信用卡-&#45;&#45;组织&ndash;&gt;-->
    <!--<{if $organ_type}>-->
    <!--<div class="credit-classify credit-organize clear">-->
    <!--<p><{$organ_type['title']}>：</p><a href='javascript:void(0);' class="credit-selected hover-style" data-id="0">不限</a>-->
    <!--<ul>-->
    <!--<{foreach from=$organ_type['children'] item=val}>-->
    <!--<li><a href='javascript:void(0);' class="hovering" data-id="<{$val['id']}>"><{$val['title']}></a></li>-->
    <!--<{/foreach}>-->
    <!--</ul>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--<{/if}>-->
    <!--</div>-->
    <!--</div>-->
    <div class="drop-down"><b class="icon-open-close icon-open"></b></div>
    <div class="clear"></div>
    <!--信用卡列表-->
    <div class="credit-card-list">
        <div class="card-detail">
            <div class="credit-detai">
                <div class="cd-title">
                    任务详情

                </div>
                <div class="cd-detail plr20">

                    <div class="fl ml20" style="width:500px">
                        <div class="title">
                            <p class="name"><{$task['title']}></p>
                            <span>发布人：<{$task['username']}></span>

                        </div>
                        <div class="card-txt mt10">
                            <ul>
                                <li><b class="icon icon-list"></b>任务期限：<{$task['limit_hour']}>小时</li>
                                <li><b class="icon icon-list"></b>任务数量:<{$task['sub_num']}></li>
                                <li><b class="icon icon-list"></b>已领取数量：<{$task['snum']}></li>
                                <li><b class="icon icon-list"></b>佣金：<{$task['commission']}></li>
                                <input type="hidden" id="input_tid" value="<{$task['tid']}>">
                            </ul>

                            <!--弹窗--立即申请-->
                            <div class="card-choice fr">
                                <{if $status==1}>
                                <a href="/task/edit.html?tid=<{$task['tid']}>" onclick="" target="_blank" class="apply-button">编辑 </a>
                                <{elseif $status==2}>
                                <a href="javascript:void(0);" onclick="" target="_blank" class="apply-button-end fr">已结束</a>
                                <{elseif $status==3}>
                                <a href="javascript:void(0);" onclick="" target="_blank" class="apply-button-end fr">已领完</a>
                                <{elseif $status==4}>
                                <a href="javascript:void(0);" onclick="ajaxApply(<{$task['tid']}>);" target="_blank" class="apply-button fr">立即领取</a>
                                <{elseif $status==5}>
                                <a href="javascript:void(0);" onclick="showCreditInfo();" target="_blank" class="apply-button">提交验证 </a>
                                <{elseif $status==6}>
                                <a href="javascript:void(0);" onclick="showCreditInfo();" target="_blank" class="apply-button">修改验证 </a>
                                <a href="/account/taskrec.html" onclick="" target="_blank" class="apply-button">查看 </a>
                                <{elseif $status==7}>
                                <a href="/account/taskrec.html" onclick="" target="_blank" class="apply-button">查看 </a>
                                <{/if}>
                            </div>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <!--选项卡切换 tab-->
            <div class="cd-title">
                任务内容
            </div>
            <div class="credit-con ptb10-lr20">
                <div class="card-detail-list">
                    <!--选项卡内容1--基本信息-->
                    <div class="credit-txt">
                        <{$task['content']}>
                    </div>
                    <!--选项卡内容2--相关费用-->
                    <div class="credit-txt" style="display: none;">
                        <span style="color:#666666;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;font-size:15px;line-height:30px;background-color:#FFFFFF;">分期费率：</span><span></span>
                        <table cellpadding="2" cellspacing="0" border="1" bordercolor="#999999" style="width:100%;">
                            <tbody>
                            <tr>
                                <td style="text-align:center;background-color:#CCCCCC;">
                                    3期
                                </td>
                                <td style="text-align:center;background-color:#CCCCCC;">
                                    6期
                                </td>
                                <td style="text-align:center;background-color:#CCCCCC;">
                                    12期
                                </td>
                                <td style="text-align:center;background-color:#CCCCCC;">
                                    18期
                                </td>
                                <td style="text-align:center;background-color:#CCCCCC;">
                                    24期
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align:center;">
                                    24%
                                </td>
                                <td style="text-align:center;">
                                    4.8%
                                </td>
                                <td style="text-align:center;">
                                    8.76%
                                </td>
                                <td style="text-align:center;">
                                    13.5%
                                </td>
                                <td style="text-align:center;">
                                    18%<span style="line-height:1.5;"></span>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <p>
                            <span style="font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;font-size:14px;line-height:1.5;color:#666666;vertical-align:top;"> </span>
                        </p>
                        <p style="font-size:14px;color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <span style="color:#666666;vertical-align:top;font-size:15px;">取现：</span><span style="font-size:15px;">&nbsp;</span><span style="font-size:15px;">最高取现比例30%，取现手续费为取现金额的2%，最低境内收费20元</span>
                        </p>
                        <p style="font-size:14px;color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <span style="color:#666666;vertical-align:top;font-size:15px;">还款：</span><span style="font-size:15px;">&nbsp;</span><span style="font-size:15px;">最低还款金额为本月账单的10%，日息0.05%</span>
                        </p>
                        <p style="font-size:14px;color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <span style="color:#666666;vertical-align:top;font-size:15px;">滞纳金：</span><span style="font-size:15px;">&nbsp;</span><span style="font-size:15px;">还款低于最低还款金额的部分需缴5%的纳滞纳金，最低收费3美元或3欧元或30人民币或30港元</span>
                        </p>
                        <p style="font-size:14px;color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <span style="color:#666666;vertical-align:top;font-size:15px;">超限费：</span><span style="font-size:15px;">&nbsp;</span><span style="font-size:15px;">超过信用额度的5%</span>
                        </p>
                        <p style="font-size:14px;color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <span style="color:#666666;vertical-align:top;font-size:15px;">溢缴费：</span><span style="font-size:15px;">&nbsp;</span><span style="font-size:15px;">存入金额超出欠款的部分，取出时收取0.3%</span>
                        </p>
                        <p style="font-size:14px;color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <span style="color:#666666;vertical-align:top;font-size:15px;">挂失费：</span><span style="font-size:15px;">&nbsp;</span><span style="font-size:15px;">40元</span>
                        </p>
                        <p style="font-size:14px;color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <span style="color:#666666;vertical-align:top;font-size:15px;">补卡费：</span><span style="font-size:15px;">&nbsp;</span><span style="font-size:15px;">15元</span>
                        </p>
                        <span style="color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;font-size:14px;line-height:1.5;"></span>
                        <p>
                            <br>
                        </p>
                        <p>
	<span style="color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;font-size:14px;line-height:1.5;"><br>
</span>
                        </p>
                        <p>
	<span style="color:#333333;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;font-size:14px;line-height:1.5;"><br>
</span>
                        </p>
                    </div>
                    <!--选项卡内容3--专享特权-->
                    <div class="credit-txt" style="display: none;">
                        <ul style="color:#222222;font-family:'Microsoft Yahei', 微软雅黑, Tahoma, Arial, Helvetica, STHeiti;background-color:#FFFFFF;">
                            <li>
                                <h4 style="font-size:14px;color:#333333;">
                                    <img src="http://www.rong360.com/static/img/credit/tequan-ico.png" alt="淘宝网">&nbsp;淘宝网
                                </h4>
                            </li>
                            <li>
                                <h4 style="font-size:14px;color:#333333;">
                                    <img src="http://www.rong360.com/static/img/credit/tequan-ico.png" alt="1000元航班延误险">&nbsp;1000元航班延误险
                                </h4>
                                <p style="margin-left:59px;font-size:14px;color:#666666;">
                                    通过指定渠道使用淘宝V卡购买机票，白金卡延误2小时、金卡延误4小时立赔1000元。
                                </p>
                            </li>
                            <li>
                                <h4 style="font-size:14px;color:#333333;">
                                    <img src="http://www.rong360.com/static/img/credit/tequan-ico.png" alt="节日惊喜 积分翻10倍">&nbsp;节日惊喜 积分翻10倍
                                </h4>
                                <p style="margin-left:59px;font-size:14px;color:#666666;">
                                    淘宝会员生日、会员入淘周年庆、淘宝新会员注册日、会员日等特殊日，使用淘宝V卡在淘宝网的支付宝快捷交易最高可享10倍中信信用卡积分。
                                </p>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>

    </div>
    <div class="holder" id="credit_pagination"></div>
</div>

<script type="text/javascript">

    function showCreditInfo(ID){
        var params = {};
        params.id = ID;
        doRequest("/task/info.html",params,false,function(data){$("body").find(".popup-credit,.popup-credit-sign").remove().end().append(data.data);},errorCallback);
    }
    //异步申请任务，也就是提交子任务
    function ajaxApply(tid){
        var params = {};
        params.tid = tid;
        doRequest("/task/ajax_apply.html",params,false,function(data){
            $("body").find(".popup-credit,.popup-credit-sign").remove().end().append(data.data);
            layer.msg(data.msg,{icon:0,time:1000,offset:300});
            location.href=data.link;

        },errorCallback);
    }
    //提交认证信息
    function submitValidate(){
        var params = {};
        var tid = $("#input_tid").val();
        var validate = $("#input_validate").val();
        //layer.msg("请输入问答标题",{icon:0,time:2000,shift:6,offset:300});return false;
        params.tid = tid;
        params.validate = validate;
//        doRequest("/task/update_subtask.html",params,false,successLoadCredit,errorCallback);
//        //刷新页面
//        location.reload();

        doRequest("/task/update_subtask.html",params,false,function(data){
            $("body").find(".popup-credit,.popup-credit-sign").remove().end().append(data.data);
            layer.msg(data.msg,{icon:0,time:1000,offset:300});

            setTimeout(function(

            ){
                location.reload();;
            },1000);


        },errorCallback);
        //location.href('www.baidu.com');
    }
    function successLoadCredit(resp){
        var totalCount = resp.data.totalCount;
        var str = "";
        if(totalCount == 0){
            str += "<div class='no-card'><b class='icon icon-hasno'></b>没有找到符合您筛选条件的信用卡，您可以重新选择!</div>";
        }
        var list = resp.data.list;
        $.each(list,function(index,data){
            str +=  data.str;
        });

        $(".credit-card-list").html(str);
        creditPage(totalCount,resp.data.pageIndex);
    }
    function loadCredit(pageIndex){
        var obj = $(".credit-classify .hover-style");
        var str = "";
        obj.each(function(){
            str += $(this).attr("data-id")+",";
        });
        str = str.substr(0,str.length-1);
        var params = {};
        params.type = str;
        params.pageIndex = pageIndex;
        //doRequest("/card/mlist.html",params,false,successLoadCredit,errorCallback);
        doRequest("/card/info.html",params,false,successLoadCredit,errorCallback);
    }

    function creditPage(total,pageIndex){
        $("#credit_pagination").pagination(total, { //recordCount在后台定义的一个公有变量，通过从数据库查询记录进行赋值，返回记录的总数
            callback: loadCredit,  //点击分页时，调用的回调函数
            prev_text: '<',  //显示上一页按钮的文本
            next_text: '>',  //显示下一页按钮的文本
            link_to:"javascript:void(0);",
            items_per_page:10,  //每页显示的项数
            num_display_entries:6,  //分页插件中间显示的按钮数目
            current_page:pageIndex,  //当前页索引
            num_edge_entries:2  //分页插件左右两边显示的按钮数目
        });
    }

    /**
     * credit-card detail 弹窗
     * */
    $("body").delegate('.popup-credit-sign .icon-close','click',function(){
        $(this).parents('.popup-credit-sign').fadeOut();
        $('.popup-credit').fadeOut();
    });
    $("body").delegate('.popup-credit-sign .tab span','click',function(){
        index = $(this).parent().children().index($(this));
        $('.popup-credit-sign .credit-con .credit-txt').eq(index).fadeIn().siblings().hide();
        $(this).addClass('popup-credit-line').siblings().removeClass('popup-credit-line');
    });
    /**
     * credit-card 类别 click effect
     * */
    $(function(){
        loadCredit(0);
        var obj=$(".credit-classify.clear");
        obj.each(function()
        {
            var _this=this;
            $( "li a,.credit-selected.hover-style",this).click(function()
            {
                $( "li a,.credit-selected.hover-style",_this).removeClass("hover-style")
                $(this).addClass("hover-style");
                $(this).removeClass("hovering");

                loadCredit(0);
            })
        })
    });


</script>
<!--footer-->
<{include file="public/footer.html"}>